//
//  WCDrawBorderView.h
//  WC
//
//  Created by 杨鑫 on 15/5/14.
//  Copyright (c) 2015年 智康. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef enum LineDrection LineDrection;
enum LineDrection {
    kLineHorizontal,
    kLineVertical
};
CG_INLINE CGPoint
CGPointPathChange(CGPoint p, LineDrection drection, int d)
{
    CGFloat scale = [UIScreen mainScreen].scale;
    int scaleX = p.x*scale;
    int scaleY = p.y*scale;
    
    CGPoint change;
    if (drection == kLineHorizontal) {
        change.x = scaleX/scale;
        change.y = (scaleY+0.5*d)/scale;
    } else {
        change.x = (scaleX+0.5*d)/scale;
        change.y = scaleY/scale;
    }
    
    return change;
}

@interface WCDrawBorderView : UIView

@property (strong, nonatomic) IBInspectable UIColor *borderColor;
@property (nonatomic) IBInspectable BOOL leftBorder;
@property (nonatomic) IBInspectable BOOL rightBorder;
@property (nonatomic) IBInspectable BOOL topBorder;
@property (nonatomic) IBInspectable BOOL bottomBorder;

@end
